home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / jpl_c.zip / STRADD.C < prev    next >
Text File  |  1986-05-18  |  768b  |  31 lines

  1. /* 1.0  05-13-85 */
  2. /************************************************************************
  3.  *            Robert C. Tausworthe                *
  4.  *            Jet Propulsion Laboratory            *
  5.  *            Pasadena, CA 91009        1985        *
  6.  ************************************************************************/
  7.  
  8. #include "defs.h"
  9. #include "stdtyp.h"
  10.  
  11. /************************************************************************/
  12.     STRING
  13. stradd(n, s, args) /* concatenate n strings args to s. return pointer s    */
  14.  
  15. /*----------------------------------------------------------------------*/
  16. STRING s, args;
  17. {
  18.     STRING p, t, *q;
  19.  
  20.     p = s;
  21.     while (*s)
  22.         s++;
  23.     for (q = &args; n-- > 0; q++)
  24.     {    t = *q;
  25.         while (*t)
  26.             *s++ = *t++;
  27.     }
  28.     *s = NULL;
  29.     return p;
  30. }
  31.